// 表单校验规则由 schema2code 生成，不建议直接修改校验规则，而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema



const validator = {
	"data_name": {
		"rules": [{
				"required": true,
				"errorMessage": "{label}无效"
			},
			{
				"format": "string",
				"errorMessage": "{label}无效"
			}
		],
		"label": "数据名称"
	},
	"key_name": {
		"rules": [{
				"required": true,
				"errorMessage": "{label}无效"
			},
			{
				"format": "string",
				"errorMessage": "{label}无效"
			}
		],
		"label": "键"
	},
	"value": {
		"rules": [{
				"required": true,
				"errorMessage": "{label}无效"
			},
			{
				"format": "string",
				"errorMessage": "{label}无效"
			}
		],
		"label": "值"
	},
	"config_type": {
		"rules": [{
				"format": "int",
				"errorMessage": "{label}无效"
			},
			{
				"range":  [{
				"text": "文字",
				"value": 1
			}, {
				"text": "布尔",
				"value": 2
			}, {
				"text": "文件",
				"value": 3
			}, {
				"text": "富文本",
				"value": 4
			}, {
				"text": "多数据/数组",
				"value": 5
			}],
				"errorMessage": "{label}无效"
			}
		],
		"label": "类型"
	},
	"config_desc": {
		"rules": [{
			"format": "string"
		}],
		"label": "说明"
	}
}

const enumConverter = {
	"config_type_valuetotext": {
		"1": "文字",
		"2": "布尔",
		"3": "文件",
		"4": "富文本"
	}
}

export {
	validator,
	enumConverter
}
